<?php
/*
	[Office 515158] (C) 2009-2012 天生创想 Inc.
	$Id: home.php 1209087 2012-01-08 08:58:28Z baiwei.jiang $
*/
define('IN_ADMIN',True);
require_once('include/common.php');
get_login($_USER->id);
$rs = $db->fetch_one_array("SELECT * FROM ".DB_TABLEPRE."loginlog where uid='".$_USER->id."'  and unionid='".union_id."' ORDER BY id desc limit 1,1");
//消息
$sms='<table width="99%" border="0" align="center" cellpadding="0" cellspacing="0"><tr>';
$sms_sql = $db->query("SELECT * FROM ".DB_TABLEPRE."sms_receive where receiveperson='".$_USER->id."' and smskey='1' and unionid='".union_id."' ORDER BY id desc LIMIT 0,6");
	$i=0;
	while ($row = $db->fetch_array($sms_sql)) {
	$i++;
		$sms.='<td width="50%"><a href="admin.php?ac=receive&fileurl=sms">'.cut_str(strip_tags($row['content']),45,'...').'</a></td>';
		if($i%2==0){
			$sms.='</tr><tr>';
		}
	}
$sms.='</tr></table>';
//获取新闻
$sql = "SELECT * FROM ".DB_TABLEPRE."news WHERE receive like'%".GET_INC_USER_NAME($_USER->id)."%' or receive='0' and unionid='".union_id."' ORDER BY id desc LIMIT 0,6";
$result = $db->fetch_all($sql);

include_once template.'home.php';
?>